/**
 * @ObjectFormat.as.as
 * 
 * @author sodaChen mail:asframe#163.com
 * @version 1.0
 * <br>Copyright (C), 2010 asFrame.com
 * <br>This program is protected by copyright laws.
 * <br>Program Name:ASFrame Log
 * <br>Date:2011-9-5
 */
package com.asframe.log.format
{
	import com.asframe.collections.maps.IMap;
	
	/**
	 * Object基类的输出格式
	 * @author sodaChen
	 * Date:2011-9-5
	 */
	public class ObjectFormat extends BasicObjectFormat
	{
		protected override function onFormatString(object:Object):String
		{
			var msg:String = "";
			if(object is IMap)
				object = IMap(object).getContainer();
			var flag:Boolean = true;
			for(var key:Object in object)
			{
				flag = false;
				msg = msg + "	[key:" + logFormat.formatObject(key,true) + "]	[value:" + logFormat.formatObject(object[key],true) + "]\n";
			}
			if(flag)
			{
				msg = object.toString();
			}
			return msg;
		}
	}
}
